package com.yangjun.common.enums;

import java.util.List;
import java.util.Map;

import com.google.common.collect.Lists;
import com.google.common.collect.Maps;

public enum SubSiteType {
	PC("PC",1),WAP("WAP",13),Android("Android",14),IOS("IOS",15),weixin("微信",21),unknown("未知",99);
	private String siteName;
	public int siteId;
	
	public String getSiteName() {
		return siteName;
	}

	public void setSiteName(String siteName) {
		this.siteName = siteName;
	}

	public int getSiteId() {
		return siteId;
	}

	public void setSiteId(int siteId) {
		this.siteId = siteId;
	}

	private SubSiteType(String siteName, int siteId) {
		this.siteName = siteName;
		this.siteId = siteId;
	}
	public static List<Map<String,Object>> getSubSiteTypeMap(List<String>  siteName){
		List<Map<String,Object>> resultList = Lists.newArrayList();
		for(SubSiteType subSiteType : SubSiteType.values()){
			String name = subSiteType.getSiteName();
			int value = subSiteType.getSiteId();
			if(siteName.contains(name)){
				Map<String,Object> item = Maps.newHashMap();
				item.put("name", name);
				item.put("value", value);
				resultList.add(item);
			}
		}
		return resultList ; 
	}
}
